package cn.wolfcode.orderserver.feign;

import cn.wolfcode.orderserver.feign.impl.ProductFeignFallBack;
import cn.wolfcode.productserver.domain.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

//name的名称一定要和订单服务的服务名保持一致
@FeignClient(name = "product-service",fallback = ProductFeignFallBack.class)
public interface ProductFeignApi {
    @RequestMapping("/product")
    public Product findByPid(@RequestParam("pid") Long pid);
}